<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>全局注册组件</title>
</head>
<body>
    <div id="app">
        <my-header></my-header>
    </div>
</body>
<script src="lib/vue.js"></script>
<script>
    Vue.component('my-header',{
        template:`<header>
            标题 ：{{msg}}
            <button @click="add">{{count}}</button>
            </header>`,
        data(){
            return {
                msg:'fghp',
                count:12
            }
        },
        methods:{
            add(){
                this.count+=100
            }
        }
    })
    new Vue({
        el:"#app",
        data:{

        }
    })
</script>
</html>